//  export function debounce(fn, delay) {
//     console.log("点击");
//     var timer = null;
//     var delay = delay || 200;
//     return function (e) {
//       console.log(e);
//         var args = arguments;
//         console.log(args);
//       var that = this;
//       clearTimeout(timer);
//       timer = setTimeout(function () {
//         fn.apply(that, args);
//       }, delay);
//     };
//   }

export function debounce(fn, delay) {
    let timer = null;
    return function (args) {
        console.log(args);
        let that = this;
        if (timer) clearTimeout(timer)
        timer = setTimeout(() => {
            fn.call(that,...args)
        },delay)
    }
}